﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AhpilyServer.Timer
{
    public delegate void TimeDelegate();
    /// <summary>
    /// 定时器模型
    /// </summary>
    public class TimerModel
    {
        public int Id;
        /// <summary>
        /// 执行的事件
        /// </summary>
        public long Time;
        private TimeDelegate timeDelegate; //定义委托
        public TimerModel(int id, long time, TimeDelegate td)
        {
            this.Id = id;
            this.Time = time;
            this.timeDelegate = td;
        }
        /// <summary>
        /// 触发任务的
        /// </summary>
        public void Run()
        {
            timeDelegate();
        }
    }
}
